The method and apparatus of this invention relate generally to the translation of one logically defined language into another. More specifically, the method and apparatus relate to a system and process for translating computer programs written in a language having the attributes of COBOL into programs having the functionality of Java.
COBOL is an acronym for COmmon Business Oriented Language. COBOL is a high-level programming language for business data processing that was designed by the CODASYL Committee in 1960. COBOL is one of the most widely used programming languages in the world. In part, because it has a natural language style that makes it easy for a programmer who did not write the original program to make corrections and changes.
Java(trademark) is a cross-platform programming language from Sun Microsystems that can be used to create animations and interactive features on World Wide Web pages. Java programs (a Java Class) may be distributed by embedding a program, or by embedding a call to the program, into an HTML document. HotJava(trademark) and Netscape Navigator(trademark) are Web browsers that run Java applications.
Both the functionality of COBOL and the functionality of Java are needed, in different ways, to strengthen the infrastructure of nearly every major financial institution in the United States. The Internet is helping to establish an international market for products and services making it a critical medium both now and in the future. Java, as a cross-platform language, can be used to establish a presence in this medium by creating interactive content that will entice users to purchase services or products from a web site regardless of the machine or device used to connect to the Internet. COBOL can help drive the engine that tabulates, tracks and records substantial amounts of financial data. Unfortunately, most institutions have large amount of legacy COBOL programs and very few Java Programs. For this reason, there are many businesses that would like to translate their COBOL programs into Java in order to use their previously developed COBOL programs for use on the Internet and across platforms.
In order to translate their COBOL programs into Java Programs, however, a method and apparatus for translating the COBOL program into a Java program is needed. More specifically, a method and apparatus for translating a COBOL program structure into a Java Class structure is needed. The method and apparatus needed would translate structural elements of COBOL, such as nested programs, procedure paragraphs and sections and record descriptions, into the analogous Java structure, such as creating methods within a Java source class file or creating a callable program interface.
The system and method of the present invention provide a COBOL to Java translator capable of translating both top-level COBOL programs and nested COBOL programs. The translation is further specified at the levels of the COBOL paragraph and section, which are translated into a Java method, and at the level of the COBOL variable, which is translated into the Java object level. Additional extensions to standard COBOL are also provided in order to ease the burden of the Java Developer
Briefly, the invention processes a plurality of COBOL source code programs into a plurality of Java source code class files, including optional inner class files, and can process the procedures and data of the COBOL source code into the corresponding methods and data of the Java source code. It does so by recognizing a COBOL template and then outputting a corresponding completed Java template. The COBOL program template helps identify values that will need to be incorporated into the translated Java class file. The Java class template provides the location that the identified values should be placed in the class file. This process of identifying and applying the templates is repeated at each translation xe2x80x9clevelxe2x80x9d as described herein. This process continues until the last translation is reached. At that point, the translation is complete. Several additional extensions to this process are also provided including the creation of a source file that provides both the Java source code and COBOL source code. Additional extensions enabling use of Structure Query Language (SQL) for database calls are also provided.